  //获取主要需求下标
  function getContent(value) {
      if (!value) return 0;
      var Content = 0;
      switch (value) {
          case 100000000:
              Content = 1;
              break;
          case 100000001:
              Content = 2;
              break;
          case 100000013:
              Content = 3;
              break;
          case 100000002:
              Content = 4;
              break;
          case 100000003:
              Content = 5;
              break;
          case 100000004:
              Content = 6;
              break;
          case 100000005:
              Content = 7;
              break;
          case 100000006:
              Content = 8;
              break;
          case 100000007:
              Content = 9;
              break;
          case 100000008:
              Content = 10;
              break;
          case 100000009:
              Content = 11;
              break;
          case 100000010:
              Content = 12;
              break;
          case 100000011:
              Content = 13;
              break;
          case 100000012:
              Content = 15;
              break;
          case 100000014:
              Content = 14;
              break;
          default:
              Content = 0;
      }
      return Content
  }
  //获取主要需求的值
  function getContentValue(value) {
    var val = parseInt(value);
      if (!val) return 0;
      var Content = 0;
      switch (val) {
          case 1:
              Content = 100000000;
              break;
          case 2:
              Content = 100000001;
              break;
          case 3:
              Content = 100000013;
              break;
          case 4:
              Content = 100000002;
              break;
          case 5:
              Content = 100000003;
              break;
          case 6:
              Content = 100000004;
              break;
          case 7:
              Content = 100000005;
              break;
          case 8:
              Content = 100000006;
              break;
          case 9:
              Content = 100000007;
              break;
          case 10:
              Content = 100000008;
              break;
          case 11:
              Content = 100000009;
              break;
          case 12:
              Content = 100000010;
              break;
          case 13:
              Content = 100000011;
              break;
          case 14:
              Content = 100000014;
              break;
          case 15:
              Content = 100000012;
              break;
          default:
              Content = 0;
      }
      return Content
  }
  //获取下标
  /**
   * 
   *
   * @param {*} targetObj 目标对象
   * @param {*} id  目标ID
   * @returns 目标ID的下标
   */
  function getPickerValue(targetObj, id) {
      for (let index in targetObj) {
          if (targetObj[index].siteId == id) {
              return index
          }
      }
  }
  //格式化时间
  function formatTime(date, isStart) {
      var year = date.getFullYear()
      var month = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
      var day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate();

      if (isStart == true) {
          return year + '-' + month + '-' + '01'
      }
      return year + '-' + month + '-' + day
  }
  module.exports = {
      getContent,
      getContentValue,
      getPickerValue,
      formatTime
  }